//---------------------------------------------------------------------------


#pragma hdrstop

#include "TLogHandler.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)
TLogHandler::TLogHandler(Client *clientobj)
{
    if(client==NULL)return;
	client=clientobj;
	client->logInstance().registerLogHandler( LogLevelDebug, LogAreaAll, this );
}

TLogHandler::~TLogHandler()
{
	client->logInstance().removeLogHandler(this);
}

void TLogHandler::handleLog( LogLevel level, LogArea area, const std::string& message )
{
	if(FOnLog)FOnLog(level,area,Utf8ToAnsi(message.c_str()).t_str());
}
